package vn.sunnet.game.SinhTon.map;

import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;

// Vi tri bat dau xuat hien cua Zombie
public class PositionAppear {
	private int map; // map
	private int position;// cac vi tri xuat hien tren man hinh
	private Vector2 vector; // vị trí xuất hiện

	public PositionAppear(int map, int position) {
		this.setMap(map);
		switch (map) {
		case 1:
			switch (position) {
			case 1:
				vector = new Vector2(50, 347);
				break;
			case 2:
				vector = new Vector2(MathUtils.random(170, 232), 480);
				break;
			case 3:
				vector = new Vector2(800, 257);
				break;
			}
			break;
		case 2:
			switch (position) {
			case 1:
				vector = new Vector2(0, MathUtils.random(288, 340));
				break;
			case 2:
				vector = new Vector2(MathUtils.random(256, 340), 490);
				break;
			case 3:
				vector = new Vector2(800, MathUtils.random(347, 380));
				break;
			}
			break;
		case 3:
			switch (position) {
			case 1:
				vector = new Vector2(0, MathUtils.random(186, 260));
				break;

			case 2:
				vector = new Vector2(MathUtils.random(400, 420), 385);
				break;
			case 3:
				vector = new Vector2(800, MathUtils.random(186, 260));
				break;
			}
			break;
		case 4:
			switch (position) {
			case 1:
				vector = new Vector2(0, MathUtils.random(290, 350));
				break;
			case 2:
				vector = new Vector2(MathUtils.random(380, 476), 490);
				break;
			case 3:
				vector = new Vector2(800, MathUtils.random(250, 290));
				break;
			}
			break;
		case 5:
			switch (position) {
			case 1:
				vector = new Vector2(0, MathUtils.random(380, 420));
				break;

			case 2:
				vector = new Vector2(MathUtils.random(333, 390), 490);
				break;
			case 3:
				vector = new Vector2(MathUtils.random(680, 730), 490);
				break;
			}
			break;
		case 6:
			switch (position) {
			case 1:
				vector = new Vector2(0, MathUtils.random(182, 258));
				break;

			case 2:
				vector = new Vector2(MathUtils.random(223, 308), 490);
				break;
			case 3:
				vector = new Vector2(800, MathUtils.random(435, 480));
				break;
			}
			break;
		case 7:
			switch (position) {
			case 1:
				vector = new Vector2(0, MathUtils.random(340, 420));
				break;

			case 2:
				vector = new Vector2(MathUtils.random(193, 225), 490);
				break;
			case 3:
				vector = new Vector2(800, MathUtils.random(209, 269));
				break;
			}
			break;
		case 8:
			switch (position) {
			case 1:
				vector = new Vector2(0, MathUtils.random(160, 200));
				break;

			case 2:
				vector = new Vector2(MathUtils.random(367, 456), 490);
				break;
			case 3:
				vector = new Vector2(800, MathUtils.random(300, 350));
				break;
			}
			break;
		case 9:
			switch (position) {
			case 1:
				vector = new Vector2(0, MathUtils.random(167, 190));
				break;

			case 2:
				vector = new Vector2(MathUtils.random(213, 248), 490);
				break;
			case 3:
				vector = new Vector2(800, MathUtils.random(200, 230));
				break;
			}
			break;
		case 10:
			switch (position) {
			case 1:
				vector = new Vector2(-30, MathUtils.random(210, 225));
				break;

			case 2:
				vector = new Vector2(MathUtils.random(167, 223), 490);
				break;
			case 3:
				vector = new Vector2(MathUtils.random(572, 586),
						MathUtils.random(403, 415));
				break;
			}
			break;
		}
	}

	public int getMap() {
		return map;
	}

	public void setMap(int map) {
		this.map = map;
	}

	public Vector2 getVector() {
		return vector;
	}

	public void setVector(Vector2 vector) {
		this.vector = vector;
	}

	public int getPosition() {
		return position;
	}

	public void setPosition(int position) {
		this.position = position;
	}
}
